package api

import (
	"kumachan/interpreter/runtime/rt"
)

func __AndBit(a bool, b bool) bool {
	return a && b
}
func __OrBit(a bool, b bool) bool {
	return a || b
}
func __NotBit(a bool) bool {
	return !a
}
func __XorBit(a bool, b bool) bool {
	return (a || b) && (!(a && b))
}

func __AndByte(a interface{}, b interface{}) uint8 {
	return rt.FromByte(a) & rt.FromByte(b)
}
func __OrByte(a interface{}, b interface{}) uint8 {
	return rt.FromByte(a) | rt.FromByte(b)
}
func __NotByte(a interface{}) uint8 {
	return ^(rt.FromByte(a))
}
func __XorByte(a interface{}, b interface{}) uint8 {
	return rt.FromByte(a) ^ rt.FromByte(b)
}
func __ShlByte(a interface{}, b uint) uint8 {
	return rt.FromByte(a) << b
}
func __ShrByte(a interface{}, b uint) uint8 {
	return rt.FromByte(a) >> b
}

func __AndWord(a interface{}, b interface{}) uint16 {
	return rt.FromWord(a) & rt.FromWord(b)
}
func __OrWord(a interface{}, b interface{}) uint16 {
	return rt.FromWord(a) | rt.FromWord(b)
}
func __NotWord(a interface{}) uint16 {
	return ^(rt.FromWord(a))
}
func __XorWord(a interface{}, b interface{}) uint16 {
	return rt.FromWord(a) ^ rt.FromWord(b)
}
func __ShlWord(a interface{}, b uint) uint16 {
	return rt.FromWord(a) << b
}
func __ShrWord(a interface{}, b uint) uint16 {
	return rt.FromWord(a) >> b
}

func __AndDword(a interface{}, b interface{}) uint32 {
	return rt.FromDword(a) & rt.FromDword(b)
}
func __OrDword(a interface{}, b interface{}) uint32 {
	return rt.FromDword(a) | rt.FromDword(b)
}
func __NotDword(a interface{}) uint32 {
	return ^(rt.FromDword(a))
}
func __XorDword(a interface{}, b interface{}) uint32 {
	return rt.FromDword(a) ^ rt.FromDword(b)
}
func __ShlDword(a interface{}, b uint) uint32 {
	return rt.FromDword(a) << b
}
func __ShrDword(a interface{}, b uint) uint32 {
	return rt.FromDword(a) >> b
}

func __AndQword(a interface{}, b interface{}) uint64 {
	return rt.FromQword(a) & rt.FromQword(b)
}
func __OrQword(a interface{}, b interface{}) uint64 {
	return rt.FromQword(a) | rt.FromQword(b)
}
func __NotQword(a interface{}) uint64 {
	return ^(rt.FromQword(a))
}
func __XorQword(a interface{}, b interface{}) uint64 {
	return rt.FromQword(a) ^ rt.FromQword(b)
}
func __ShlQword(a interface{}, b uint) uint64 {
	return rt.FromQword(a) << b
}
func __ShrQword(a interface{}, b uint) uint64 {
	return rt.FromQword(a) >> b
}


